package com.zto.sch.web;

import org.springframework.messaging.Message;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;

/**
 * @program: sch-diy-parent
 * @description:
 * @author: sch
 * @create: 2020-12-20 10:43
 **/
@Controller
public class MessageController {

    @MessageMapping("/chat")
    public String broadCast(Message message) {
        byte[] bytes = (byte[]) message.getPayload();
        System.out.println("--------------" + new String(bytes));

        return "success";
    }
}
